/**************************************************************************//**
\file  windspeed.h

\brief Interface to the wind speed sensor.

\author
    Satxo

\internal
  History:
    21/10/12 R. Rodrigues - Created
******************************************************************************/

#ifndef _WINDSPEED_H
#define _WINDSPEED_H

/******************************************************************************
                   Includes section
******************************************************************************/
// \cond
#include <types.h>
#include <sensors.h>
// \endcond

/******************************************************************************
                   Types section
******************************************************************************/
// states
typedef enum
{
  WINDSPEED_IDLE,					// idle
  WINDSPEED_RETURN,					// return to top layer task handler
  WINDSPEED_WAIT,					// delay
  WINDSPEED_GET_WINDSPEED,
  WINDSPEED_FORMAT_WINDSPEED
} WindSpeedStates_t;

// Control structure
typedef struct  {
	uint16_t windSpeedData;									// Contains the result of sampling
} WindSpeedControl_t;

/******************************************************************************
                   Prototypes section
******************************************************************************/
/**************************************************************************//**
\brief  Opens the component to use.

\return
  BC_SUCCESS - the component is ready to been use.
  BC_FAIL - otherwise.

******************************************************************************/
result_t openWindSpeed(void);

/**************************************************************************//**
\brief  Performs the test if the component have completed request.

\return
  BC_FAIL - the previous request is not completed.
  BC_SUCCESS - otherwise.
******************************************************************************/
result_t closeWindSpeed(void);

/**************************************************************************//**
\brief Reads the wind speed value.
******************************************************************************/
void readWindSpeedData(void (*f)(uint16_t data));

#endif /* _WINDSPEED_H */
// eof windspeed.h
